from datetime import timedelta
from ws.views.user_view import UserQuery


method_list = [
    ('get_usrs_list', UserQuery),
    ('test', UserQuery),
]

beat_schedule = []
DATA_QUERY_GROUPS = {}

for func, cls in method_list:
    beat_schedule.append(
        {
            'type': 'broadcast',
            'message': {'group': func},
            'schedule': timedelta(seconds=60)
        }
    )
    DATA_QUERY_GROUPS[func] = getattr(cls, func)


# DATA_QUERY_GROUPS = {
#     'get_usrs_list': UserQuery.get_usrs_list,
# }
#
# beat_schedule = [
#     {
#         'type': 'broadcast',
#         'message': {'group': 'get_usrs_list'},
#         'schedule': timedelta(seconds=60)
#     },
# ]
